package io.renren.modules.generator.service.impl;

import io.renren.modules.generator.entity.WgzRoomDataEntity;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.generator.dao.WgzTransferRegistrationDao;
import io.renren.modules.generator.entity.WgzTransferRegistrationEntity;
import io.renren.modules.generator.service.WgzTransferRegistrationService;
import org.springframework.util.StringUtils;


@Service("wgzTransferRegistrationService")
public class WgzTransferRegistrationServiceImpl extends ServiceImpl<WgzTransferRegistrationDao, WgzTransferRegistrationEntity> implements WgzTransferRegistrationService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        QueryWrapper<WgzTransferRegistrationEntity> wgzTransferRegistrationEntityQueryWrapper = new QueryWrapper<>();

        if (!StringUtils.isEmpty(params.get("oldId"))){
            wgzTransferRegistrationEntityQueryWrapper.eq("old_id",params.get("oldId"));
        }
        if (!StringUtils.isEmpty(params.get("oldName"))){
            wgzTransferRegistrationEntityQueryWrapper.eq("old_name",params.get("oldName"));
        }
        IPage<WgzTransferRegistrationEntity> page = this.page(
                new Query<WgzTransferRegistrationEntity>().getPage(params),
                wgzTransferRegistrationEntityQueryWrapper
        );

        return new PageUtils(page);
    }

}